home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr47 / ucrasm27.zip / SOURCE.ZIP / UNIONSET.ASM < prev    next >
Assembly Source File  |  1991-10-12  |  770b  |  51 lines

  1. StdGrp        group    stdlib,stddata
  2. stddata        segment    para public 'sldata'
  3. stddata        ends
  4. ;
  5. stdlib        segment    para public 'slcode'
  6.         assume    cs:stdgrp
  7. ;
  8. ;
  9. ; union-    Unions one set with another.
  10. ;
  11. ; inputs:
  12. ;
  13. ;    ES:DI-  Points at the destination set (at its mask byte).
  14. ;    DX:SI-    Points at the mask byte of the source set.
  15. ;
  16. ;
  17. ;
  18.         public    sl_union
  19. ;
  20. sl_union    proc    far
  21.         push    ds
  22.         push    ax
  23.         push    cx
  24.         push    si
  25.         push    di
  26.         mov    ds, dx
  27. ;
  28.         mov    al, es:[di]        ;Get mask bytes
  29.         mov    ah, [si]
  30.         add    si, 8            ;Skip to start of set
  31.                 add    di, 8
  32.         mov    cx, 256
  33. unionLp:    test    ah, [si]
  34.         jz    Next
  35.         or    es:[di], al
  36. Next:        inc    si
  37.         inc    di
  38.         loop    unionLp
  39. ;
  40.         pop    di
  41.         pop    si
  42.         pop    cx
  43.         pop    ax
  44.         pop    ds
  45.         ret
  46. sl_union    endp
  47. ;
  48. ;
  49. stdlib        ends
  50.         end
  51.